<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:th="http://www.thymeleaf.org">
<head>
<title>首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
	 <div class="container"  id="content">
		 <section class="content-header">
			 <h1>
				 <i class="fa fa-file"></i>
				 <strong>数据点位管理</strong>
			 </h1>
			 <ol class="breadcrumb">
				 <li><a href="#"><i class="fa fa-home "></i>Home</a></li>
				 <li>远程设备采集</li>
				 <li class="active">数据点位管理</li>
			 </ol>
		 </section>
		 <!-- Main content -->
		 <section class="content">
			 <div class="box box-info">
			 	 <div class="box-header with-border">
                     <i class="fa fa-th-list"></i>
                     <h4 class="box-title">数据采集单元</h4>
                 </div>
                 <div class="box-body">
                    <div class="form-inline">
                    <div class="input-group">
						<input type="text" class="form-control" id="keyword"  placeholder="Search..." />
						<span class="input-group-btn">
						<button  type="button" class="btn btn-info searchBtn">查询</button>
						<button  type="button" name="reset" id="reset-btn" class="btn btn-info resetBtn">撤消</button>
						</span>
					</div>
					<div class="btn-group pull-right">
						<button type="button" class="btn btn-info  addscadaBtn">新增</button>
						<button type="button" class="btn btn-info  eidtscadaBtn">编辑</button>
						<button type="button" class="btn btn-info  delscadaBtn">删除</button>
					</div>
				 </div>
                 </div>
				<div class="box box-body" style="width:100%; overflow-x:scroll;">
					<table id="dataTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="1000px" align="center">
						<thead>
							<tr>
								<th width="3%">序号</th>
								<th width="2%"><input type="checkbox" id="checkAllContract"/></th>
								<th width="20%">名称</th>
								<th width="15%">别名</th>
								<th width="5%">创建人</th>
								<th width="5%">创建时间</th>
								<th width="15%">备注</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
				<div>
					<h4>
						<strong>采集点位</strong>
					</h4>
				</div>
				<div class="box-body">
                    <div class="form-inline">
                    <div class="input-group">
						<input class="form-control" type="hidden" id="ScadaRtuBaseInfoId" name="ScadaRtuBaseInfoId" />
						<input type="text" class="form-control" id="keyword1"  placeholder="Search..." />
						<span class="input-group-btn">
						<button  type="button" class="btn btn-info searchBtn1">查询</button>
						<button  type="button" name="reset" id="reset-btn" class="btn btn-info resetBtn1">撤消</button>
						</span>
					</div>
					<div class="btn-group pull-right">
						<button type="button" class="btn btn-info" id="VirtualPointBtn">虚点建立</button>
						<button type="button" class="btn btn-info" id="realPointBtn">实点建立</button>
						<button type="button" class="btn btn-info" id="editScadaBasePointBtn">编辑</button>
						<button type="button" class="btn btn-info" id="delScadaBasePointBtn">删除</button>
					</div>
				 </div>
                 </div>
                 <div class="box box-body" style="width:100%; overflow-x:scroll;">
				<table id="ScadaBasePointTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="1000px" align="center">
					<thead>
						<tr>
							<th width="3%">序号</th>
							<th width="2%"><input type="checkbox" id="checkAllContract1"/></th>
							<th width="4%">名称</th>
							<th width="4%">别名</th>
							<th width="4%">点位类型</th>
							<th width="3%">数据类型</th>
							<th width="4%">计量单位</th>
							<th width="4%">上线</th>
							<th width="4%">下线</th>
							<th width="4%">采集字段</th>
							<th width="4%">创建人</th>
							<th width="4%">创建时间</th>
							<th width="4%">备注</th>
						</tr>
					</thead>
					<tbody>
					</tbody>
				</table>
				</div>
			</div>
	  </section>
	  <!-- 新增编辑数据采集单元 -->
	  <div class="modal" id="divideScadaModal">
			<div class="modal-dialog" role="dialog">
				<div class="modal-content">
					<form id="divideScadaAtrrForm">
						<input class="form-control" type="hidden" id="ScadaRtuid" name="ScadaRtuid" />
						<input class="form-control" type="hidden" id="ScadaRtucreateTime" name="ScadaRtucreateTime" />
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>数据采集单元</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label">名称</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" id="ScadaRtuname" name="ScadaRtuname" />
										</div>
										<div class="col-md-1">
											<span style="color: #F00; fontsize: 30px">*</span>
										</div>
									</div>
									<label class="col-sm-2 control-label">别名</label>
									<div class="col-sm-4">
										<div class="col-md-11">
										<input class="form-control" id="ScadaRtualias" name="ScadaRtualias" />
										</div>
										<div class="col-md-1">
											<span style="color: #F00; fontsize: 30px">*</span>
										</div>
									</div>
								</div>
							<div class="form-group">
				              <label class="col-sm-2 control-label">备注</label>
				                <div class="col-sm-4" style="width: 80%">
				                  <div class="col-md-11">
				                    <textarea class="form-control" style="width: 100%" rows="2"
												name="ScadaRtumemo" id="ScadaRtumemo"></textarea></div>
				                </div>
					         </div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-primary saveScadaBtn">保存</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">返回</button>
						</div>
					</form>
				</div>
			</div>
		</div>
		
	  <!-- 新增编辑采集点位 -->
	  <div class="modal" id="ScadaBasePointModal">
			<div class="modal-dialog" role="dialog">
				<div class="modal-content">
					<form id="ScadaBasePointAtrrForm">
						<input class="form-control" type="hidden" id="ScadaRtuBaseInfoId" name="ScadaRtuBaseInfoId" />
						<input class="form-control" type="hidden" id="ScadaBasePointId" name="ScadaBasePointId" />
						<input class="form-control" type="hidden" id="ScadaBasePointcreateTime" name="ScadaBasePointcreateTime" />
						<input class="form-control" type="hidden" id="pointType" name="pointType" />
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>数据采集单元</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label">名称</label>
									<div class="col-sm-4" style="width: 80%">
										<div class="col-md-11">
											<input class="form-control" id="ScadaBasePointname" name="ScadaBasePointname" />
										</div>
										<div class="col-md-1">
											<span style="color: #F00; fontsize: 30px">*</span>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">别名</label>
									<div class="col-sm-4" style="width: 80%">
										<div class="col-md-11">
											<input class="form-control" id="ScadaBasePointalias" name="ScadaBasePointalias" />
										</div>
										<div class="col-md-1">
											<span style="color: #F00; fontsize: 30px">*</span>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">绑定数据</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<select id="dataField" class="form-control">
												<option value="pointOne" selected="selected">pointOne</option>
												<option value="pointTwo">pointTwo</option>
												<option value="pointThree">pointThree</option>
												<option value="pointFour">pointFour</option>
												<option value="pointFive">pointFive</option>
												<option value="pointSix">pointSix</option>
												<option value="pointSeven">pointSeven</option>
												<option value="pointEight">pointEight</option>
												<option value="pointNine">pointNine</option>
												<option value="pointTen">pointTen</option>
											</select>
										</div>
									</div>
									<label class="col-sm-2 control-label">类型</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<select id="DataType" class="form-control">
												<option value="1">开关量</option>
												<option value="0">模拟量</option>
											</select>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">报警值</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<select id="SwitchingValue" class="form-control">
												<option value="0">0</option>
												<option value="1">1</option>
												<option value="" selected="selected">无</option>
											</select>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">正常上限</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" id="UpperLimit" name="UpperLimit" type="text" disabled="disabled"/>
										</div>
									</div>
									<label class="col-sm-2 control-label">正常下限</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" id="lowLimit" name="lowLimit" type="text" disabled="disabled"/>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">计量单位</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<select id="unit" class="form-control">
												<option></option>
			                          			<option th:each="danwei:${danweis}"
											  		th:text="${danwei.title}"></option>
											</select>
										</div>
									</div>
								</div>
							<div class="form-group">
				              <label class="col-sm-2 control-label">备注</label>
				                <div class="col-sm-4" style="width: 80%">
				                  <div class="col-md-11">
				                    <textarea class="form-control" style="width: 100%" rows="2"
												name="ScadaBasePointmemo" id="ScadaBasePointmemo"></textarea></div>
				                </div>
					         </div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-primary saveScadaBasePointBtn">保存</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">返回</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	 	<script th:src="@{/scada/scadabasepointindex.js}"></script>
	 	<script>
	 		$(function () {
	 			$('#DataType').change(function (){
	 				if($(this).children('option:selected').val()=="1"){//开关量
	 					document.getElementById("UpperLimit").disabled = true;
	 					document.getElementById("lowLimit").disabled = true;
	 					document.getElementById("SwitchingValue").disabled = false;
	 					jQuery('#UpperLimit').val('');
	 					jQuery('#lowLimit').val('');
	 					jQuery('#SwitchingValue').val('');
	 				}
	 				if($(this).children('option:selected').val()=="0"){//模拟量
	 					document.getElementById("UpperLimit").disabled = false;
	 					document.getElementById("lowLimit").disabled = false;
	 					document.getElementById("SwitchingValue").disabled = true;
	 					jQuery('#UpperLimit').val('');
	 					jQuery('#lowLimit').val('');
	 					jQuery('#SwitchingValue').val('');
	 				}
	 			});
	 		});
	 	</script>
	 </div> 
</body>
</html>